package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.hardware.components.RamMemory;

public class RamMemoryMapper implements RowMapper<RamMemory> {

	@Override
	public RamMemory mapRow(final ResultSet result, final int row) throws SQLException {
	    	    
	    RamMemory ramMemory = new RamMemory(result.getString("name"), 
	                                     result.getInt("energyTurnOn"),
	                                     result.getInt("capacity"),
	                                     result.getInt("prize"));
	    
	    ramMemory.setIdComponent(result.getInt("idComponent"));
		return ramMemory;
	}

}
